package priv.pront.code.mati.national.practice;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author: Pronting
 * @Description:
 * @DateTime: 2023/12/1 12:52
 **/
public class P5726_打分 {

    static int n;
    static int[] a;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        a = new int[n];
        for (int i = 0; i < n; i++) a[i] = scanner.nextInt();
        Arrays.sort(a);
        int sum = 0;
        for (int i = 1; i < n - 1; i++) {
            sum += a[i];
        }
        System.out.printf("%.2f", sum * 1.0 / (n - 2));
    }
}
